﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Tour.BLL;
using Tour.DAL;

public partial class Tourist_Tourist : System.Web.UI.Page
{
    public static int PageSize = 4;
    public int PageIndex { get; set; }
    //public string EventTypeTextId { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetPropertyFromQueryString();
            LoadData();
            LoadTourhot();
            LoadTourQuocTe();
            LoadSukien();
            LoadNew();
            LoadDichvu();
        } 
    }
    void GetPropertyFromQueryString()
    {           
        PageIndex = CommonHelper.QueryStringInt("PageIndex", 1);
    }
    void LoadData()
    {
        int TotalRow = 0;
        rpt.DataSource = TblTourManager.CreateInstant().tr_SelectTblTourByTourTypeAllChild(null,"tour-noi-dia", null, null, null, null, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        //rpt.DataSource = TblTourManager.CreateInstant().tr_SelectTblTourByTourTypeAllChild(null, "", null, null, null, null, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        rpt.DataBind();
    }
    void LoadTourQuocTe()
    {
        int TotalRow = 0;
        rptTourQuocTe.DataSource = TblTourManager.CreateInstant().tr_SelectTblTourByTourTypeAllChild(null, "tour-quoc-te", null, null, null, null, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        //rpt.DataSource = TblTourManager.CreateInstant().tr_SelectTblTourByTourTypeAllChild(null, "", null, null, null, null, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        rptTourQuocTe.DataBind();
    } 
    void LoadTourhot()
    {
        int TotalRow = 0;
        rptTourHot.DataSource = TblTourManager.CreateInstant().tr_SelectTblTourByTourTypeAllChild(null, "tour-noi-dia", null, null, null, null, 30, PageIndex, out TotalRow, "CreatedDate", "DESC");
        rptTourHot.DataBind();
    }
    void LoadSukien()
    {
        int TotalRow = 0;
        rptSukien.DataSource = TblEventManager.CreateInstant().SelectTblEventBy(null, null, "dich-vu", "", true, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        rptSukien.DataBind();
    }
    void LoadDichvu()
    {
        int TotalRow = 0;
        rptDichvu.DataSource = TblEventManager.CreateInstant().SelectTblEventBy(null, null, "dich-vu-2", "", true, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        rptDichvu.DataBind();
    }
    void LoadNew()
    {
        int TotalRow = 0;
        //ParentId = int.Parse(GetLocaleResourceString("Module.Home.TourNoiDiaID"));
        rptNew.DataSource = TblEventManager.CreateInstant().SelectTblEventBy(null, null, "su-kien-du-lich", "", true, PageSize, PageIndex, out TotalRow, "CreatedDate", "DESC");
        rptNew.DataBind();
    }    
}